// @flow
import React, { Component, Fragment } from 'react';
import { connect } from 'react-redux';
// import { createSelector } from 'reselect';
// store
import type { State } from 'store';
// import type { UserData } from 'store/modules/user';
// import { MenuActions } from 'store/actionCreators';
// components
///E:\Project\melog\melog\melog-frontend\src\components\header\Navbar

import Navbar from 'components/Header/Navbar';
import Menu from 'components/Header/Menu';
// container
import UserMenuButtonContainer from './UserMenuButton';
import UserMenuListContainer from './UserMenuList';

type Props = {
    menuData: any,
    // thumbnail?: string,
    activePage: string
};
class NavbarContainer extends Component<Props> {
    render() {
        const { thumbnail, menuData, activePage } = this.props;
        return (
            <Fragment>
                <Navbar
                    menu={<Menu menuData={menuData} activePage={activePage} />}
                    rightUserButton={<UserMenuButtonContainer />}
                    rightUserMenu={<UserMenuListContainer />}
                />
            </Fragment>
        );
    }
}
// 把store导入Pros
const mapStatetoProps = ({ user, base }: State) => {
    return {
        menuData: base && base.headers
    };
};

// const mapDispatchtoProps = () => ({});

export default connect(
    mapStatetoProps,
    () => ({})
)(NavbarContainer);
